
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理</title>
<link href="__PUBLIC__/ht/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/ht/js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/ht/js/action.js"></script>
</head>
<body>

<div class="aaa_pts_show_1">【 产品管理 】</div>

<div class="aaa_pts_show_2">
    <div class="aaa_pts_3">
      
      <div class="pro_4 bord_1">
         <div class="pro_5">产品名称：<input type="text" class="inp_1 inp_6" id="name" value="{$name}"></div>
         <div class="pro_5">
               推荐产品：
               <select class="inp_1 inp_6" id="tuijian">
			      <option value="">全部产品</option>
                  <option value="1" <?php echo $tuijian=='1' ? 'selected="selected"' : NULL ?>>推荐产品</option>
                  <option value="0" <?php echo $tuijian=='0' ? 'selected="selected"' : NULL ?>>非推荐产品</option>
	           </select>
         </div>
		 <!--获取url上的pid-->
         <div class="pro_6"><input type="button" class="aaa_pts_web_3" value="搜 索" style="margin:0;" onclick="product_option(0);"></div>
      </div>
      
      <table class="pro_3">
         <tr class="tr_1">
           <td style="width:80px; border-right:0px;">ID</td>
           <td style="width:90px; border-left:0px; border-right:0px;">图片</td>
           <td style="border-right:0px; border-left:0px;">[分类名]商品名称</td>
           <td style="width:80px; border-right:0px; border-left:0px;">价格/元</td>
           <td style="width:150px; border-left:0px;">操作</td>
         </tr>
         <tbody id="news_option">
         <!-- 遍历 -->
          <volist name="productlist" id="v" empty="暂时没有数据">
           <tr data-id="{$v.id}" data-name="{$v.name}" data-price="{$v.price_yh}" data-price_jf="{$v.price_jf}" data-sort="{$v.sort}" data-renqi="{$v.renqi}" data-num="{$v.num}">
             <td>{$v.id}</td>
             <td style="padding:8px;">
              <if condition='$v.import_id neq 0'>
                <img src="<?php echo C('IMPORT_IMG_URL'); ?>{$v.photo_x}" width="60px;" height="60px;" />
              <else />
                <img src="__DATA__/{$v.photo_x}" width="60px;" height="60px;" />
              </if>
            </td>
             <td><span style="color:red;">[{$v.cat_name}]</span>{$v.name}</td>
             <td>{$v.price_yh}</td>
            <td>
              <a href="#" onclick="window_opener(this)">选择</a>
             </td>
           </tr>
          </volist>
         <!-- 遍历 -->
         </tbody>
         <tr>
            <td colspan="10" class="td_2">
                  {$page_index}  
             </td>
         </tr>
      </table>      
    </div>
    
</div>
<script>
function product_option(page){
  var obj={
	   "name":$("#name").val(),
	   "tuijian":$("#tuijian").val()
	  }
	  //alert(obj);exit();
  var url='?page='+page;
  $.each(obj,function(a,b){
	  url+='&'+a+'='+b;
	 });
  location=url;
}

//选择返回
function window_opener(e){
  var obj=$(e);
  window.opener.document.getElementById('pid').value=obj.parent().parent().attr('data-id');
  window.opener.document.getElementById('pro_name').value=obj.parent().parent().attr('data-name');
  window.opener.document.getElementById('name').value=obj.parent().parent().attr('data-name');
  window.opener.document.getElementById('price').value=obj.parent().parent().attr('data-price');
  window.opener.document.getElementById('sort').value=obj.parent().parent().attr('data-sort');
  window.opener.document.getElementById('renqi').value=obj.parent().parent().attr('data-renqi');
  window.opener.document.getElementById('num').value=obj.parent().parent().attr('data-num');
  window.opener.document.getElementById('price_jf').value=obj.parent().parent().attr('data-price_jf');
  window.opener.document.getElementById('yin0').style.display='none';
  window.opener.document.getElementById('yin1').style.display='none';
  window.opener.document.getElementById('yin2').style.display='none';
  window.opener.document.getElementById('yin3').style.display='none';
  window.opener.document.getElementById('yin4').style.display='none';
  window.opener.document.getElementById('yin5').style.display='none';
  window.opener.document.getElementById('yin6').style.display='none';
  window.opener.document.getElementById('yin7').style.display='none';
  window.opener.document.getElementById('yin8').style.display='none';
  window.opener.document.getElementById('imgs_add').style.display='none';
  window.opener.document.getElementById('yin10').style.display='none';
  window.opener.document.getElementById('yin11').style.display='none';
  window.opener.document.getElementById('yin12').style.display='none';
  window.opener.document.getElementById('yin13').style.display='none';
  window.opener.document.getElementById('yin14').style.display='none';
  window.close();
}
</script>
</body>
</html>
